<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
    <!--<div class="head">
        <div class="headone"><i class="el-icon-menu"></i><span>移交管理</span></div>
    </div>-->
    <el-drawer title="高级搜索" :visible.sync="selectDrawer" direction="rtl" :before-close="closeSelect" size="85%">
        <div  style="padding-left: 20px;height: calc(100vh - 37px);overflow-y: auto;overflow-x: hidden">
            <!--<el-transfer filterable  :filter-method="filterMethod" :titles="['待选择条件', '已选择条件']" :button-texts="['取消', '选择']"
            filter-placeholder="请输入信息项" v-trim v-model="selectValue" :data="allMap.listSelect"> </el-transfer>-->
            <el-form  size="mini" label-width="130px" >
                <el-row :gutter="20">
                    <el-col :span="8" v-for="select in allMap.listSelect">
                        <el-form-item :prop="select.key" :label="select.label" v-if="select.condition=='drop'">
                            <el-cascader clearable v-if="select.key=='szcs'" :props="addressProps"  v-trim v-model="select.value" :options="select.options"  style="width:180px;"></el-cascader>
                            <el-cascader clearable v-else v-trim v-model="select.value" :options="select.options"  style="width:180px;"></el-cascader>
                        </el-form-item>
                        <el-form-item :prop="select.key" :label="select.label" v-if="select.condition=='dropLike'">
                            <el-cascader clearable v-if="select.key=='szcs'" :props="addressProps" :props="{ checkStrictly: true }" v-trim v-model="select.value" :options="select.options"  style="width:180px;"></el-cascader>
                            <el-cascader clearable v-else v-trim v-model="select.value" :props="{ checkStrictly: true }" :options="select.options"  style="width:180px;"></el-cascader>
                        </el-form-item>
                        <el-form-item :prop="select.key" :label="select.label" v-if="select.condition=='like'">
                            <el-input maxlength="30"  v-trim v-model="select.value"  style="width:180px;"></el-input>
                        </el-form-item>
                        <el-form-item :prop="select.key" :label="select.label" v-if="select.condition=='number'">
                            <el-input-number maxlength="30"  v-trim v-model="select.value"  style="width:180px;"></el-input-number>
                        </el-form-item>
                        <el-form-item :prop="select.key" :label="select.label" v-if="select.condition=='date'">
                            <el-date-picker type="date" placeholder="开始日期" v-trim v-model="select.startDate" size="mini" value-format="yyyy-MM-dd" style="width: 130px;"></el-date-picker>
                            -<el-date-picker type="date" placeholder="结束日期" v-trim v-model="select.endDate" size="mini" value-format="yyyy-MM-dd" style="width: 130px;"></el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col>
                        <el-button  @click="selectDrawer = false" plain>返回</el-button>
                        <el-button type="primary" @click="doSearch" plain>搜索</el-button>
                        <el-button type="info" @click="doClear" plain>清空</el-button>
                    </el-col>
                </el-row>
            </el-form>
        </div>
    </el-drawer>
    <el-row class="header navbar bg-white">
        <div class="btn-group tool-button" style="line-height: 50px;">
            样品编号或名称:<el-input placeholder="样品编号或名称" v-trim v-model="pageForm.searchKeyword"  size="mini" style="width:180px;" clearable></el-input>
            报告编号:<el-input placeholder="报告编号" v-trim v-model="pageForm.bgbh"  size="mini" style="width:180px;" clearable></el-input>
            检验状态: <el-select v-trim v-model="pageForm.lczt" placeholder="检验状态" size="mini" style="width:180px;" clearable>
                <el-option v-for="item in allMap.lcztOptions" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
            </el-select>
            流转状态:<el-select v-trim v-model="pageForm.lzzt" placeholder="流转状态" size="mini" style="width:180px;" clearable>
                <el-option v-for="item in allMap.lzztOptions" :key="item.value" :label="item.label" :value="item.value">
                </el-option>
            </el-select>
            <el-button slot="append" icon="el-icon-search" size="mini" @click="doSearch" circle></el-button>
            <el-button  size="mini" @click="getSelect" >高级搜索</el-button>
        </div>

        <div class="pull-right offscreen-right" style="margin-right: 20px;line-height: 50px;">
            <el-row>
                <el-tooltip class="item" effect="dark" content="刷新" placement="top">
                    <el-button circle icon="el-icon-refresh" size="mini" @click="resetColData"/>
                </el-tooltip>
                <el-tooltip class="item" effect="dark" content="显隐列" placement="top" >
                    <el-popover placement="bottom" width="800" trigger="click">
                        <el-row :gutter="20">
                            <el-col :span="24">
                                <div class="btn-group tool-button" style="line-height: 50px;">
                                    <el-button size="mini" @click="resetColData">全 选</el-button>
                                    <el-button size="mini" @click="clearColData">清 空</el-button>
                                </div>
                            </el-col>
                        </el-row>
                        <el-col :span="6" v-for="col in colData">
                            <el-switch v-trim v-model="col.show" :active-text="col.label" > </el-switch>
                        </el-col>
                        <el-button circle icon="el-icon-s-grid" size="mini" slot="reference"></el-button>
                    </el-popover>
                </el-tooltip>
                <el-tooltip class="item" effect="dark" content="导出EXCEL" placement="top">
                    <el-button circle icon="el-icon-download" size="mini" @click="createExport"/>
                </el-tooltip>
            </el-row>
        </div>
    </el-row>
    <el-row class="el-table-container">
        <el-table :data="tableData" ref="multipleTable" @sort-change='pageOrder' min-height="520" :height="tableHeight" border size="small" header-align="center" style="width: 100%" >
            <el-table-column label="操作" min-width="80" header-align="center">
                <template slot-scope="scope">
                    <el-button @click="detail(scope.row.id)" size="mini">详情</el-button>
                </template>
            </el-table-column>
            <el-table-column v-if="colData.length==0 || colData[0].show"  sortable="custom" prop="ypbh" label="样品编号" min-width="150px;" header-align="center"  show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[1].show"  sortable="custom" prop="bgbh" label="报告编号" min-width="150px;" header-align="center"  show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[2].show" sortable="custom" prop="lczt" label="检验状态" min-width="100px;" header-align="center"  >
                <template slot-scope="scope" ><span :class="'statusCss-'+scope.row.lczt"><i :class="'el-icon-'+scope.row.lczt"/>{{getDict(scope.row.lczt,allMap.lcztMap)}}</span></template>
            </el-table-column>
            <el-table-column v-if="colData.length==0 || colData[3].show" sortable="custom" prop="lzzt" label="流转状态" min-width="150px;" header-align="center"  >
                <template slot-scope="scope" >
                    <span :class="'lzstatusCss-'+scope.row.lzzt"><i :class="'lzel-icon-'+scope.row.lzzt"/>{{getDict(scope.row.lzzt,allMap.lzztMap)}}</span>
                    <span v-if="scope.row.lzzt<3"><span v-if="scope.row.status=='0'">(待接收)</span>
                    <span v-if="scope.row.status=='1'">(已接收)</span>
                    <span v-if="scope.row.status=='-1'">(已拒收)</span></span>
                </template>
            </el-table-column>
            <el-table-column v-if="colData.length==0 || colData[4].show" sortable="custom" prop="jyks" label="检验部门" min-width="200px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[5].show" sortable="custom" prop="zh" label="项目类别" min-width="100px;" header-align="center" >
                <template slot-scope="scope" >{{getDict(scope.row.zh,allMap.zhMap)}}</template>
            </el-table-column>
            <el-table-column v-if="colData.length==0 || colData[6].show" sortable="custom"  prop="ypmc" label="产品名称" min-width="150px;" header-align="center"  show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[7].show" sortable="custom" prop="jylx" label="检验类别" min-width="100px;" header-align="center" >
                <template slot-scope="scope" >{{getDict(scope.row.jylx,allMap.jylxMap)}}</template>
            </el-table-column>
            <el-table-column v-if="colData.length==0 || colData[8].show" sortable="custom" prop="yplx" label="产品类型" min-width="200px;" header-align="center" >
                <template slot-scope="scope" >{{getDict(scope.row.yplx,allMap.yplxMap)}}</template>
            </el-table-column>
            <el-table-column v-if="colData.length==0 || colData[9].show" sortable="custom" prop="ypdj" label="样品等级" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[10].show" sortable="custom" prop="ypzt" label="样品特性/状态" min-width="130px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[11].show" sortable="custom" prop="bysl" label="备样数量" min-width="100px;" header-align="center" show-overflow-tooltip >
                <template slot-scope="scope" >{{scope.row.bysl}}{{scope.row.unit}}</template>
            </el-table-column>
            <el-table-column v-if="colData.length==0 || colData[12].show" sortable="custom" prop="jysl" label="检样数量" min-width="100px;" header-align="center" show-overflow-tooltip >
                <template slot-scope="scope" >{{scope.row.jysl}}{{scope.row.unit}}</template>
            </el-table-column>
            <el-table-column v-if="colData.length==0 || colData[13].show" sortable="custom" prop="szcs" label="所在城市" min-width="200px;" header-align="center" >
                <template slot-scope="scope" >{{getDict(scope.row.szcs,allMap.xzqhMap)}}</template>
            </el-table-column>
            <el-table-column v-if="colData.length==0 || colData[14].show" sortable="custom" prop="scrqpc" label="原编号/生产日期" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[15].show" sortable="custom" prop="sb" label="商标" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[16].show" sortable="custom" prop="ggxh" label="规格型号" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[17].show" sortable="custom" prop="cyry" label="企业联系人" min-width="120px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[18].show" sortable="custom" prop="jyfdb" label="企业联系电话" min-width="120px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[19].show" sortable="custom" prop="cydw" label="抽样单位" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[20].show" sortable="custom" prop="cyryBy" label="抽样人员" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[21].show" sortable="custom" prop="cyrq" label="抽样日期" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[22].show" sortable="custom" prop="cydbh" label="抽样单编号" min-width="120px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[23].show" sortable="custom" prop="cyjs" label="抽样基数" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[24].show" sortable="custom" prop="cydd" label="抽样地点" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>

            <el-table-column v-if="colData.length==0 || colData[25].show" sortable="custom" prop="wtdw" label="委托单位" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[26].show" sortable="custom" prop="wtdwdz" label="委托单位地址" min-width="200px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[27].show" sortable="custom" prop="wtdwlxr" label="委托单位法人" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[28].show" sortable="custom" prop="wtdwsj" label="委托单位信用代码" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[29].show" sortable="custom" prop="wtdwdh" label="委托单位电话" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[30].show" sortable="custom" prop="wtdwyb" label="委托单位邮编" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[31].show" sortable="custom" prop="sjdw" label="受检单位" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[32].show" sortable="custom" prop="sjdwdz" label="受检单位地址" min-width="200px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[33].show" sortable="custom" prop="sjdwlxr" label="受检单位法人" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[34].show" sortable="custom" prop="sjdwsj" label="受检单位信用代码" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[35].show" sortable="custom" prop="sjdwdh" label="受检单位电话" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[36].show" sortable="custom" prop="sjdwyb" label="受检单位邮编" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[37].show" sortable="custom" prop="scdw" label="生产单位" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[38].show" sortable="custom" prop="scdwdz" label="生产单位地址" min-width="200px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[39].show" sortable="custom" prop="scdwlxr" label="生产单位法人" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[40].show" sortable="custom" prop="scdwsj" label="生产单位信用代码" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[41].show" sortable="custom" prop="scdwdh" label="生产单位电话" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[42].show" sortable="custom" prop="scdwyb" label="生产单位邮编" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>

            <el-table-column v-if="colData.length==0 || colData[43].show" sortable="custom" prop="jyxm" label="检验项目" min-width="200px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[44].show" sortable="custom" prop="jyyj" label="检验依据" min-width="150px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[45].show" sortable="custom" prop="yhxtk" label="样品处置" min-width="120px;" header-align="center" >
                <template slot-scope="scope" >{{getDict(scope.row.yhxtk,allMap.ypczMap)}}</template>
            </el-table-column>
            <el-table-column v-if="colData.length==0 || colData[46].show" sortable="custom" prop="jyhth" label="检验合同号" min-width="120px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[47].show" sortable="custom" prop="jcfyry" label="检查封样人员" min-width="130px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[48].show" sortable="custom" prop="bgfsfs" label="报告领取" min-width="100px;" header-align="center" >
                <template slot-scope="scope" >
                    <span v-if="scope.row.bgfsfs==0">邮寄</span>
                    <span v-if="scope.row.bgfsfs==1">自取</span>
                </template>
            </el-table-column>
            <el-table-column v-if="colData.length==0 || colData[49].show" sortable="custom" prop="dyrq" label="到样日期" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[50].show" sortable="custom" prop="wcqx" label="完成期限" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[51].show" sortable="custom" prop="bz" label="报告备注" min-width="300px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[52].show" sortable="custom" prop="tssm" label="其它说明" min-width="300px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[53].show" sortable="custom" prop="jyrq" label="检验日期" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[54].show" sortable="custom" prop="jyjg" label="检验结果" min-width="100px;" header-align="center" show-overflow-tooltip >
                <template slot-scope="scope" >
                    <span v-if="scope.row.jyjg=='0'">合格</span>
                    <span v-if="scope.row.jyjg=='1'">不合格</span>
                    <span v-if="scope.row.jyjg=='2'">不判定</span>
                </template>
            </el-table-column>
            <el-table-column v-if="colData.length==0 || colData[55].show" sortable="custom" prop="jyjl" label="检验结论" min-width="300px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[56].show" sortable="custom" prop="jyqksm" label="检验情况说明" min-width="300px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[57].show" sortable="custom" prop="dyzt" label="打印状态" min-width="100px;" header-align="center" >
                <template slot-scope="scope" >
                    <template v-if="scope.row.dyzt==1">
                        已打印
                    </template>
                    <template v-else>
                        未打印
                    </template>
                </template>
            </el-table-column>
            <el-table-column v-if="colData.length==0 || colData[58].show" sortable="custom" prop="djr" label="登记人" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[59].show" sortable="custom" prop="djsj" label="登记时间" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[60].show" sortable="custom" prop="bzr" label="编制人" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[61].show" sortable="custom" prop="jyry" label="检验人员" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[62].show" sortable="custom" prop="bzsj" label="编制时间" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[63].show" sortable="custom" prop="shr" label="审核人" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[64].show" sortable="custom" prop="shsj" label="审核时间" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[65].show" sortable="custom" prop="pzr" label="批准人" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[66].show" sortable="custom" prop="pzsj" label="批准时间" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[67].show" sortable="custom" prop="yjr" label="移交情况" min-width="300px;" header-align="center" align="left" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[68].show" sortable="custom" prop="tyr" label="退样人" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[69].show" sortable="custom" prop="tysj" label="退样时间" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[70].show" sortable="custom" prop="ghr" label="归还人" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>
            <el-table-column v-if="colData.length==0 || colData[71].show" sortable="custom" prop="ghsj" label="归还时间" min-width="100px;" header-align="center" show-overflow-tooltip ></el-table-column>

        </el-table>
    </el-row>
    <el-row class="el-pagination-container">
        <el-pagination @size-change="pageSizeChange" @current-change="pageNumberChange" :current-page="pageForm.pageNumber" :page-sizes="[10, 20, 30, 50]"
                       :page-size="pageForm.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="pageForm.totalCount">
        </el-pagination>
    </el-row>
    <el-drawer :wrapperClosable="false" title="样品详情" :visible.sync="drawer" direction="rtl" size="80%" @opened="openIframe" destroy-on-close>
        <iframe id="iframeDetail" src="" width="100%" height="100%" frameborder="0" marginheight="0"></iframe>
    </el-drawer>
</div>
<script>
    new Vue({
        el: "#app",
        data: function () {
            var allMap = {
                jylxMap:${jylxMap},
                lcztMap:${lcztMap},
                lzztMap:${lzztMap},
                zhMap:${zhMap},
                yplxMap:${yplxMap},
                xzqhMap:${xzqhMap},
                ypczMap:${ypczMap},
                lcztOptions:${lcztOptions},
                lzztOptions:${lzztOptions},
                listSelect:${listSelect}
            };
            return {
                tableHeight:520,
                allMap: allMap,
                tableData: [],
                tableDataCount:"",
                pageForm: {},
                deltailURL:"",
                drawer:false,
                selectDrawer: false,
                direction: 'rtl',
                selectValue:[],
                filterMethod(query, item) {
                    return item.id.indexOf(query) > -1;
                },
                addressProps: {
                    lazy: true,
                        lazyLoad (node, resolve) {
                        $.post(base + "/platform/sys/dict/dictTreeChild", {code:node.data.code}, function (data) {
                            if (data.code == 0) {
                                resolve(data.data)
                            } else {
                                self.$message({message: data.msg,type: 'error'});
                            }
                        }, "json");
                    }
                },
                colData:[]
            }
        },
        methods: {
            getSelect(){
                this.selectDrawer = true
            },
            closeSelect(){
                this.selectDrawer = false
            },
            handleClick(tab, event) {
                this.pageForm.pageSize = 0;
                this.pageData();
            },
            pageNumberChange: function (val) {//页码更新操作
                this.pageForm.pageNumber = val;
                this.pageData();
            },
            pageSizeChange: function (val) {//分页大小更新操作
                this.pageForm.pageSize = val;
                this.pageData();
            },
            pageOrder: function (column) {//按字段排序
                this.pageForm.pageOrderName = column.prop;
                this.pageForm.pageOrderBy = column.order;
                this.pageData();
            },
            pageData: function () {//加载分页数据
                var self = this;
                //self.pageForm.listSelect =  //Array.from()
                self.pageForm.listSelect= [];
                for(const select of self.allMap.listSelect){
                    if(select.value || select.startDate ||select.endDate){
                        self.pageForm.listSelect.push(select);
                    }
                }
                self.pageForm.listSelect=JSON.stringify(self.pageForm.listSelect)
                sublime.showLoadingbar();//显示loading
                $.post(base + "/platform/bus/reports/sReport/data", self.pageForm, function (data) {
                    sublime.closeLoadingbar();//关闭loading
                    if (data.code == 0) {
                        self.tableData = data.data.list;
                        self.pageForm.totalCount = data.data.totalCount;
                    } else {
                        self.$message({
                            message: data.msg,
                            type: 'error'
                        });
                    }
                }, "json");
            },
            doSearch: function () {
                this.pageForm.pageNumber = 1;
                this.selectDrawer = false;
                this.pageData();
            },
            doClear:function(){
                this.allMap.listSelect.forEach((item,index)=>{
                    if(item.condition=='drop'){
                        item.value=[];
                    }if(item.condition=='dropLike'){
                        item.value=[];
                    }else if(item.condition=='like'||item.condition=='number'){
                        item.value="";
                    }else{
                        item.startDate = "";
                        item.endDate = "";
                    }
                })
                this.allMap.listSelect=JSON.parse(JSON.stringify(this.allMap.listSelect));
            },
            detail(id){
                this.drawer=true;
                this.deltailURL="/platform/bus/ypxx/jbxx/detail/"+id;
            },
            openIframe:function(){
                $("#iframeDetail").attr("src",this.deltailURL);
            },
            getDict: function (val, map) {
                val = val + "";
                if (val != null && val != undefined && val != "" && map != null && map != undefined) {
                    var str = val.split(",");
                    var strname = "";
                    for (var a = 0; a < str.length; a++) {
                        strname += map[str[a]];
                        if (strname == null) {
                            alert(1)
                        }
                        if (a < (str.length - 1)) {
                            strname += "/";
                        }
                    }
                    return strname;
                }
                return "";
            },
            resetColData(){
                this.colData.forEach((item)=>{
                    item.show=true;
                })
            },
            clearColData(){
                this.colData.forEach((item)=>{
                    item.show=false;
                })
            },
            createExport(){
                var self = this;
                var url = base + "/platform/bus/reports/sReport/export";
                var form = document.createElement("form");
                form.style.display = 'none';
                form.action = url;
                form.method = "post";
                document.body.appendChild(form);

                if(nONull(self.pageForm.searchKeyword)){
                    var searchKeyword = document.createElement("input");
                    searchKeyword.type = "hidden";
                    searchKeyword.name = "searchKeyword";
                    searchKeyword.value = self.pageForm.searchKeyword;
                    form.appendChild(searchKeyword);
                }

                if(nONull(self.pageForm.bgbh)){
                    var bgbh = document.createElement("input");
                    bgbh.type = "hidden";
                    bgbh.name = "bgbh";
                    bgbh.value = self.pageForm.bgbh;
                    form.appendChild(bgbh);
                }
                if(nONull(self.pageForm.lczt)) {
                    var lczt = document.createElement("input");
                    lczt.type = "hidden";
                    lczt.name = "lczt";
                    lczt.value = self.pageForm.lczt;
                    form.appendChild(lczt);
                }
                if(nONull(self.pageForm.lzzt)) {
                    var lzzt = document.createElement("input");
                    lzzt.type = "hidden";
                    lzzt.name = "lzzt";
                    lzzt.value = self.pageForm.lzzt;
                    form.appendChild(lzzt);
                }
                if(nONull(self.pageForm.listSelect)) {
                    var listSelect = document.createElement("input");
                    listSelect.type = "hidden";
                    listSelect.name = "listSelect";
                    listSelect.value = self.pageForm.listSelect;
                    form.appendChild(listSelect);
                }
                if(nONull(self.colData)) {
                    var colData = document.createElement("input");
                    colData.type = "hidden";
                    colData.name = "colData";
                    colData.value = JSON.stringify(self.colData)
                    form.appendChild(colData);
                }
                if(nONull(self.pageForm.pageOrderName)) {
                    var pageOrderName = document.createElement("input");
                    pageOrderName.type = "hidden";
                    pageOrderName.name = "pageOrderName";
                    pageOrderName.value = self.pageForm.pageOrderName;
                    form.appendChild(pageOrderName);
                }
                if(nONull(self.pageForm.pageOrderBy)) {
                    var pageOrderBy = document.createElement("input");
                    pageOrderBy.type = "hidden";
                    pageOrderBy.name = "pageOrderBy";
                    pageOrderBy.value = self.pageForm.pageOrderBy;
                    form.appendChild(pageOrderBy);
                }
                form.submit();
                form.remove();
            }

        },
        created: function () {
            this.doSearch();
        },
        mounted:function (){
            this.tableHeight = window.innerHeight- 150;
            /*let arr = [];
            this.$refs.multipleTable.$children.forEach((item) => {
                if (item.label != undefined && item.prop != undefined) {
                    arr.push({
                        label: item.label,
                        prop: item.prop,
                    });
                }
            });
            console.log('处理后想要的表头集合tableHeaders===' , arr)*/

            //获取表头方法
                let tableHeader = []
                let tableHeaders = []
                //所有表格数据  $refs对应的表头
                tableHeader = this.$refs['multipleTable'].store.states._columns
                if (tableHeader && tableHeader.length > 0) {
                    //递归出需要的表头数据 放进数组里
                    tableHeader.forEach((column, _index) =>{
                        //这里根据需求有条件去取舍 如果是多级表头的是 判断是否有子表头：column.children.length >0 有的话再往里放
                        if(column.property){
                            //这里根据需要放入需要的相关 参数
                            tableHeaders.push({
                                id:_index,
                                show: true,
                                prop: column.property,
                                label: column.label,
                                sortable: column.sortable,
                                align: column.align,
                                width: column.width,
                                template: true
                            })
                        }

                    })
                }
                this.colData=tableHeaders;
        }
    });

    function nONull(val) {
        if (val != null && val != undefined && val != "") {
            return true;
        } else {
            return false;
        }
    }
</script>
<!--#
}
#-->
